package com.oc.mba.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * OcQuestionOption entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "oc_question_option", catalog = "openmba")
public class OcQuestionOption implements java.io.Serializable {

	// Fields

	private Integer id;
	private OcQuestion ocQuestion;
	private String optionContent;
	private Short optionCorrect;

	// Constructors

	/** default constructor */
	public OcQuestionOption() {
	}

	/** full constructor */
	public OcQuestionOption(OcQuestion ocQuestion, String optionContent,
			Short optionCorrect) {
		this.ocQuestion = ocQuestion;
		this.optionContent = optionContent;
		this.optionCorrect = optionCorrect;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "question_id", nullable = false)
	public OcQuestion getOcQuestion() {
		return this.ocQuestion;
	}

	public void setOcQuestion(OcQuestion ocQuestion) {
		this.ocQuestion = ocQuestion;
	}

	@Column(name = "option_content", nullable = false)
	public String getOptionContent() {
		return this.optionContent;
	}

	public void setOptionContent(String optionContent) {
		this.optionContent = optionContent;
	}

	@Column(name = "option_correct", nullable = false)
	public Short getOptionCorrect() {
		return this.optionCorrect;
	}

	public void setOptionCorrect(Short optionCorrect) {
		this.optionCorrect = optionCorrect;
	}

}